package com.hzw.common;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;

public class FileCopy {
    public static void main(String[] args) {
        String  fileNname = null;
        File sourceFile = new File("");
        File destFile = new File("E:\\javaee文件\\hzw_project\\src\\main\\resources\\static\\images\\bg.jpg"+ fileNname);
        FileInputStream fis= null;
        FileOutputStream fos = null;
        try{
            fis = new FileInputStream(sourceFile);
            fos = new FileOutputStream(destFile);
            // 定义缓冲区
            byte[] buffer = new byte[1024];
            int data;
            while((data = fis.read(buffer))!= -1){
                fos.write(buffer,0,data);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}
